home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Sprite 1984 - 1993
/
Sprite 1984 - 1993.iso
/
src
/
lib
/
include
/
struct.h
< prev
next >
Wrap
C/C++ Source or Header
|
1991-11-05
|
970b
|
29 lines
/*
* struct.h --
*
* Declarations of macros for getting infomation about the fields
* in a structure.
*
* Copyright 1991 Regents of the University of California
* Permission to use, copy, modify, and distribute this
* software and its documentation for any purpose and without
* fee is hereby granted, provided that this copyright
* notice appears in all copies. The University of California
* makes no representations about the suitability of this
* software for any purpose. It is provided "as is" without
* express or implied warranty.
*
* $Header: /sprite/src/lib/include/RCS/struct.h,v 1.1 91/11/05 15:44:02 rab Exp $ SPRITE (Berkeley)
*/
#ifndef _STRUCT_H
#define _STRUCT_H
#define fldoff(str, fld) ((int)&(((struct str *)0)->fld))
#define fldsiz(str, fld) (sizeof(((struct str *)0)->fld))
#define strbase(str, ptr, fld) \
((struct str *)((char *)(ptr)-fldoff(str, fld)))
#endif /* _STRUCT_H */